home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Super PC 34
/
Super PC 34 (Shareware).iso
/
spc
/
UTIL
/
DJGPP2
/
V2
/
DJLSR200.ZIP
/
src
/
libc
/
ansi
/
stdlib
/
rand.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1994-12-07
|
318 b
|
19 lines
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <stdlib.h>
static unsigned long long next = 0;
int
rand(void)
{
next = next * 1103515245L + 12345;
next = (next<<15) ^ (next >> 27);
return (int)((next >> 4) & RAND_MAX);
}
void
srand(unsigned seed)
{
next = seed;
}